﻿var CSP_ServiceDetail = {
        LB_TitleId:"",       //标题的Id
        ImageHeadId:"",      //
        IsCreateOrder:false, //是否下订单
        ServiceId:undefined, //服务ID
        ContactPhone:"",
        SetHeadImage:function(obj) {    //设置头部的head图片
            var urls = $(obj).parent().parent();
            var lis = urls.find("li");
            $.each(lis, function (index, data) {
                $(data).removeClass("current")
            });

            $(obj).parent().addClass("current");
            $("#"+this.ImageHeadId).attr("src", $(obj).attr("src"));
        },
        ShowCurrentTab:function(id) {
            this.CancelAllTab();
            $("#Select" + id).attr("class", "trigger current");
            $("#" + id).show();
            $("#" + id).children("div.panel-hd").hide();
        },
        CancelAllTab:function () {
            $("#DetailTabs").find("li").attr("class", "trigger");
            $("#TeachingDetail").hide();
            $("#TotalRate").hide();
            $("#AppointmentRecord").hide();
            $("#Authentication").hide();

        },
        //加入收藏
        BookMarkSite:function () {
            var ctrl = (navigator.userAgent.toLowerCase()).indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL';
            if (document.all) {
                window.external.addFavorite(window.location.href, $("#"+this.LB_TitleId).html());
            } else if (window.sidebar) {
                window.sidebar.addPanel($("#"+this.LB_TitleId).html(), window.location.href, "");
            } else {
                alert('您可以尝试通过快捷键' + ctrl + ' + D 加入到收藏夹~')
            }
        },
        CSP_Order:function ()
        {
            if (this.IsCreateOrder)
            {
                var href="/MyHome/ConsumeOrder/CreateOrder.aspx?id="+this.ServiceId;
                window.location.href=href;
            }
            else {
                     DialogMessage.Show(2, "请拨打预约咨询<b>电话</b>：[<span style='color:red'><b>"+this.ContactPhone+"</b></span>],^_^", function () {
                           
                        });  //请选择服务类型
            }
        }
}


        $().ready(function () {
            document.getElementById("bdshell_js").src = "http://share.baidu.com/static/js/shell_v2.js?cdnversion=" + new Date().getHours();
            var thumbs = $(".thumbs").find("li");
            $.each(thumbs, function (index, data) {
                if ($(data).find("img").attr("src") == undefined||$(data).find("img").attr("src") =="") {
                    $(data).hide();
                }
            });
        });